<?php 
namespace Admin\Controller;
use Think\Controller;

class CommentController extends AdminController
{
	public function index()
	{
		$com = M('comment');
		$list = $com->select();
		$this->assign('list',$list);
		$this->display('Comment/index');
	}

	public function del()
	{
		if (empty($_GET['id'])) {
            $this->error('没有id');
            exit;
        }
        $id = I('get.id/d');
    
        if (M('Comment')->delete($id) > 0) {
            $this->success('恭喜您!删除成功!');
        } else {
            $this->error('删除失败!');
        }
	}

}